﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using KeRui.Common;
using System.Collections.Generic;

public partial class Manage_System_ToolLog : System.Web.UI.Page
{
    #region 分页
    //基础
    public List<KeRui.Model.AdminLog> list;
    public int PageSize = 20;                               //每页数量
    public int PageIndex = PageRequest.GetInt("page", 1);   //请求的页码
    public int PageCS = PageRequest.GetInt("cs", -1);       //记录总数
    public int PageCount = 0;                               //总页数
    public string PageShow = "";                            //分页显示
    ///参数
    public string Flag = PageRequest.GetString("flag");
    public int FlagLike = PageRequest.GetInt("flaglike",0);
    public int UserID = PageRequest.GetInt("useridi", -1);
    public string StartTime = PageRequest.GetString("starttime");
    public string EndTime = PageRequest.GetString("endtime");
    #endregion 分页

    protected void Page_Load(object sender, EventArgs e)
    {
        ManageHelper.CheckAdminLogin();
        ManageHelper.CheckAdminPower("system_toollog");
        KeRui.BLL.AdminLog bll = new KeRui.BLL.AdminLog();
        list = bll.GetList(PageSize, PageIndex, Flag, FlagLike, UserID, StartTime, EndTime);

        //总数
        if (PageCS == -1)
            PageCS = bll.GetCount(Flag, FlagLike, UserID, StartTime, EndTime);
        //总页数
        if (PageCS % PageSize == 0)
            PageCount = PageCS / PageSize;
        else
            PageCount = PageCS / PageSize + 1;
        //分页显示
        PageShow = ManageHelper.showSplitPage("ToolLog.aspx?cs=" + PageCS.ToString() + "&page={0}&Flag=" + Flag + "&FlagLike=" + FlagLike + "&UserID=" + UserID + "&StartTime=" + StartTime + "&EndTime=" + EndTime,PageIndex,PageSize,PageCS);

    }
}
